/////////////////////////////////////////////////////////////////////////////
// Name:        mainpanel.cpp
// Purpose:     
// Author:      Julian Smart
// Modified by: 
// Created:     18/02/2009 19:18:16
// RCS-ID:      
// Copyright:   
// Licence:     New BSD License
/////////////////////////////////////////////////////////////////////////////

// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"

#ifdef __BORLANDC__
#pragma hdrstop
#endif

#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif

////@begin includes
////@end includes

#include "mainpanel.h"

////@begin XPM images
////@end XPM images


/*
 * MainPanel type definition
 */

IMPLEMENT_DYNAMIC_CLASS( MainPanel, wxPanel )


/*
 * MainPanel event table definition
 */

BEGIN_EVENT_TABLE( MainPanel, wxPanel )

////@begin MainPanel event table entries
////@end MainPanel event table entries

END_EVENT_TABLE()


/*
 * MainPanel constructors
 */

MainPanel::MainPanel()
{
    Init();
}

MainPanel::MainPanel(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
{
    Init();
    Create(parent, id, pos, size, style);
}


/*
 * MainPanel creator
 */

bool MainPanel::Create(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
{
////@begin MainPanel creation
    wxPanel::Create(parent, id, pos, size, style);
    CreateControls();
    if (GetSizer())
        GetSizer()->Fit(this);
////@end MainPanel creation
    return true;
}


/*
 * MainPanel destructor
 */

MainPanel::~MainPanel()
{
////@begin MainPanel destruction
////@end MainPanel destruction
}


/*
 * Member initialisation
 */

void MainPanel::Init()
{
////@begin MainPanel member initialisation
    m_textCtrl = NULL;
    m_logCtrl = NULL;
    m_inputFormat = NULL;
    m_speakCtrl = NULL;
////@end MainPanel member initialisation
}


/*
 * Control creation for MainPanel
 */

void MainPanel::CreateControls()
{    
////@begin MainPanel content construction
    MainPanel* itemPanel1 = this;

    wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
    itemPanel1->SetSizer(itemBoxSizer2);

    wxNotebook* itemNotebook3 = new wxNotebook( itemPanel1, ID_BLURT_NOTEBOOK, wxDefaultPosition, wxDefaultSize, wxBK_DEFAULT );

    m_textCtrl = new wxTextCtrl( itemNotebook3, ID_TEXT_CTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_RICH2 );

    itemNotebook3->AddPage(m_textCtrl, _("Text"));

    m_logCtrl = new wxTextCtrl( itemNotebook3, ID_LOG_CTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_RICH2 );

    itemNotebook3->AddPage(m_logCtrl, _("Log"));

    itemBoxSizer2->Add(itemNotebook3, 1, wxGROW|wxALL, 5);

    wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer2->Add(itemBoxSizer6, 0, wxALIGN_CENTER_HORIZONTAL, 5);

    wxStaticText* itemStaticText7 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Input format:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer6->Add(itemStaticText7, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxArrayString m_inputFormatStrings;
    m_inputFormatStrings.Add(_("Text"));
    m_inputFormatStrings.Add(_("HTML"));
    m_inputFormatStrings.Add(_("SSML"));
    m_inputFormatStrings.Add(_("Native"));
    m_inputFormat = new wxChoice( itemPanel1, ID_INPUT_FORMAT, wxDefaultPosition, wxDefaultSize, m_inputFormatStrings, 0 );
    m_inputFormat->SetStringSelection(_("Text"));
    itemBoxSizer6->Add(m_inputFormat, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    m_speakCtrl = new wxButton( itemPanel1, ID_SPEAK, _("&Speak"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer6->Add(m_speakCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxButton* itemButton10 = new wxButton( itemPanel1, wxID_PREFERENCES, _("&Preferences"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer6->Add(itemButton10, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxButton* itemButton11 = new wxButton( itemPanel1, wxID_OPEN, _("&Open"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer6->Add(itemButton11, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

////@end MainPanel content construction
}


/*
 * Should we show tooltips?
 */

bool MainPanel::ShowToolTips()
{
    return true;
}

/*
 * Get bitmap resources
 */

wxBitmap MainPanel::GetBitmapResource( const wxString& name )
{
    // Bitmap retrieval
////@begin MainPanel bitmap retrieval
    wxUnusedVar(name);
    return wxNullBitmap;
////@end MainPanel bitmap retrieval
}

/*
 * Get icon resources
 */

wxIcon MainPanel::GetIconResource( const wxString& name )
{
    // Icon retrieval
////@begin MainPanel icon retrieval
    wxUnusedVar(name);
    return wxNullIcon;
////@end MainPanel icon retrieval
}
